from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, BigInteger,String, Integer, Float,Text

Base = declarative_base()
# 定义 Player 对象:
class a01(Base):
    # 表的名字:
    __tablename__ = 'a01'

    # 表的结构:
    a0000 = Column(String(120), primary_key=True)
    A0101 = Column(String(36))
    A1701 = Column(Text)
    A0107 = Column(Text)
    A0184 = Column(Text)


    # 增加 to_dict() 方法到 Base 类中
    def to_dict(self):
        return {c.name: getattr(self, c.name, None) for c in self.__table__.columns}
    # 将对象可以转化为 dict 类型
    Base.to_dict = to_dict


class XXJL(Base):
    # 表的名字:
    __tablename__ = 'xxjl'

    # 表的结构:
    id = Column(BigInteger, primary_key=True)
    kssj = Column(String(100))
    jssj = Column(String(100))
    sjcd = Column(String(100))
    ksnl = Column(String(100))
    jsnl = Column(String(100))
    pid = Column(String(100))
    xx = Column(String(100))
    zy = Column(String(100))
    sfz = Column(String(100))
    name = Column(String(100))

    # 增加 to_dict() 方法到 Base 类中
    def to_dict(self):
        return {c.name: getattr(self, c.name, None) for c in self.__table__.columns}
    # 将对象可以转化为 dict 类型
    Base.to_dict = to_dict



class ZWJL(Base):
    # 表的名字:
    __tablename__ = 'zwjl'

    # 表的结构:
    id = Column(BigInteger, primary_key=True)
    kssj = Column(String(100))
    jssj = Column(String(100))
    sjcd = Column(String(100))
    ksnl = Column(String(100))
    jsnl = Column(String(100))
    dm = Column(String(100))
    gzdw = Column(String(100))
    gzzw = Column(String(100))    
    gzlx = Column(String(100))
    pid = Column(String(100))
    name = Column(String(100))
    sfz = Column(String(100))


    # 增加 to_dict() 方法到 Base 类中
    def to_dict(self):
        return {c.name: getattr(self, c.name, None) for c in self.__table__.columns}
    # 将对象可以转化为 dict 类型
    Base.to_dict = to_dict